<admintpl file="header"/>
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
  <ul class="nav nav-tabs">
     <li class="active"><a href="{:U('Messages/index')}">私信列表</a></li>
     <li><a href="{:U('Messages/send')}">发送私信</a></li>
  </ul>
		<form class="well form-search" method="post" action="{:U('Messages/index')}">
			<div class="search_type cc mb10">
				<div class="mb10">
					<span class="mr20">发信人ID：
						<input type="text" name="userid" value="{$formpost.userid}"  style="width: 80px;">
							收信人ID：
						<input type="text" name="to_userid" value="{$formpost.to_userid}"  style="width: 80px;">
	               		发信时间：
						<input type="text" name="start_time" value="{$formpost.start_time}" class="J_date" style="width: 80px;">~
						<input type="text" name="end_time" value="{$formpost.end_time}" class="J_date" style="width: 80px;"> &nbsp; &nbsp;
						<input type="submit" class="btn btn-primary" name="search" value="搜索" />
						<if condition="$num neq 0">
							共有 {$num} 条相关记录
						</if>
					</span>
				</div>
			</div>
		</form>
    <div class="table_list">
      <div class="p10"><div class="pages"> {$Page} </div> </div>
      <table width="100%" class="table table-hover">
        <thead>
          <tr>
            <th width="50px">ID</th>
            <th width="200px">收信人ID：用户昵称</th>
            <th>内容</th>
            <th width="200px">发信人ID：用户昵称</th>
            <th width="120">发布时间</th>
            <th width="40">操作</th>
          </tr>
        </thead>
        <foreach name="lists" item="vo">
        	<tr>
				<td>{$vo.id}</td>
		    	<td class='emoji'>
				{$vo.to_userid}：
    			<foreach name="users" item="user">
						<if condition="$user['id'] eq $vo['to_userid']">
						<php> 
							$base64 = $user['nickname'];
					 	echo $base64 = preg_replace_callback ( '/@E(.{6}==)/', function ($r) {
										return base64_decode ( $r [1] );
								}, $base64 );
							$uid = $user['id'];
						</php>
	        	</if>
        	</foreach>
		    	</td>
				<td>{$vo.content|msubstr=0,64}</td>
		    	<td class='emoji'>
				{$vo.userid}：
        		<foreach name="users" item="user">
						<if condition="$user['id'] eq $vo['userid']">
								<php> 
									$base64 = $user['nickname'];
							 	echo $base64 = preg_replace_callback ( '/@E(.{6}==)/', function ($r) {
												return base64_decode ( $r [1] );
										}, $base64 );
									$uid = $user['id'];
								</php>
		        	</if>
            	</foreach>
		    	</td>
				<td>{$vo.created}</td>
				<td>
					<if condition="$roleid eq 1">
					<a class="J_ajax_del" href="{:U('Messages/delete',array('id'=>$vo['id']))}">删除</a>
					<else />
					无权限
        			</if>
				</td>
			</tr>
        </foreach>
        <thead>
          <tr>
            <th width="50px">ID</th>
            <th width="200px">收信人ID：用户昵称</th>
            <th>内容</th>
            <th width="200px">发信人ID：用户昵称</th>
            <th width="120">发布时间</th>
            <th width="40">操作</th>
          </tr>
        </thead>
      </table>
      <div class="p10"><div class="pages"> {$Page} </div> </div>
    </div>
</div>
<script type="text/javascript" src="__ROOT__/statics/js/common.js"></script>
<script type="text/javascript" src="__ROOT__/statics/js/content_addtop.js"></script>
<script>
$('.emoji').emoji();
</script>
</body>
</html>